<?php 
class Category extends Module {
    public function add($caption, $item_type = '') {
        $caption = trim($caption);
        if (empty($caption)) {
            tos_die('error request');
        }
        
        $node_id = m('node')->add_node('category', $caption, '', '', '', NODE_ACCESS_PUBLIC);
        return $node_id;
    }
}
?>